package org.ocean.online.auth;

import org.apache.commons.lang.StringUtils;
import org.ocean.online.web.workspace.ViewOnlyPage;

/**
 * 用于服务端主动推送过期时间
 * @author yexinzhou
 *
 */
public class ClientOn extends ViewOnlyPage{

	public ClientOn(){
		
	}
	@Override
	public void renderPage() {
		String expireTime = this.getStringParam("expireTime");
		if(StringUtils.isNotBlank(expireTime)){
			try{
				AuthManager.getInstance().setExpireTime(Long.valueOf(expireTime));
				this.getResponse().write("update_expireTime_success");
			}catch(Exception ex){
				this.getResponse().write("update_expireTime_fail:"+ex.getMessage());
			}
			
		}else{
			this.getResponse().write("system_online");
		}
		
	}
}
